home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / SOUND / PLAY_SRC.ZIP / PLAY.DOC < prev    next >
Encoding:
Text File  |  1994-11-25  |  8.6 KB  |  261 lines

  1.  
  2.  
  3.                      Extreme's Advanced Music System (AMS)
  4.                      .-----------------------------------.
  5.  
  6.  
  7. 1.0 - Introduction
  8. ------------------
  9.  
  10. This is the player routine for our music system that let you use the AMS
  11. modules in your own productions. You may use this as you wish as long as you
  12. give me (Baldric of Extreme) credits for the player.
  13. (Donations are VERY welcome)
  14.  
  15.  
  16. 1.1 - Programming notes.
  17. ------------------------
  18.  
  19. To be able to use this player you must code in Protected Mode, as we have no
  20. plans to convert it to real mode. The Protected mode header we use is made
  21. by TRAN, and the current version is 2.5. For your convenience we included the
  22. sligthly changed version of TRAN'S header, so you can start immediately.
  23.  
  24.  
  25. 1.2 - Copyright notice
  26. ----------------------
  27.  
  28. This program is copyrighted 1994 by Extreme's Tracker Developing Team and
  29. may not be distributed in any other form than the evaluation version,
  30. providing that the following rules are respected.
  31.  
  32.    * Modifications in any of the distributed .OBJ files and documents
  33.      are strictly prohibited!
  34.    * The distributor may only charge a fee up to the costs of the public
  35.      domain disk and/or the postage fee.
  36.    * On request of the author, the distributor agrees to stop distrubuting
  37.      the program and data involved.
  38.    * Disassembling, decompiling, re-sourcing or otherwise reverse
  39.      engineering the program is not allowed.
  40.  
  41. By copying, distrubuting and/or using the program you indicate your
  42. acceptance of the above rules.
  43.  
  44. 1.3 - Disclaimer
  45. ----------------
  46.  
  47. There is no warranty for the program, to the extent permitted by applicable
  48. law. Except when otherwise stated in writing the copyright holders and/or
  49. other parties provide the program "as is" without warranty of any kind,
  50. either expressed or implied, including, but not limited to, the implied
  51. warranties of merchantability and fitness for a particular purpose. The
  52. entire risk as to the quality and performance of the program is with you.
  53. Should the program prove defective, you assume the cost of all necessary
  54. servicing, repair or correction.
  55.  
  56. In no event unless required by applicable law or agreed to in writing will
  57. any copyright holder, or any other party who may redistribute the program
  58. as permitted above, be liable to you for damages, including any general,
  59. special, incidental or consequential damages arising out of the use or
  60. inability to use the program (including but not limited to loss of data or
  61. data being rendered inaccurate or losses sustained by you or third parties
  62. or a failure of the program to operate with any other programs), even if
  63. such holder or other party has been advised of the possibility of such
  64. damages.
  65.  
  66.  
  67. 2.0 - Functions
  68. ---------------
  69.  
  70. The following variables are available in the system at the moment:
  71.  
  72. ──────────────────────┬─────────────────────────────────────────────────────────
  73.    PositionJump       │
  74. ──────────────────────┘
  75.  
  76.    Set this to a proper position whenever you want to jump in the music.
  77.  
  78.  
  79. ──────────────────────┬─────────────────────────────────────────────────────────
  80.    LoadOffset         │
  81. ──────────────────────┘
  82.  
  83.    See explanation below
  84.  
  85.  
  86. ──────────────────────┬─────────────────────────────────────────────────────────
  87.    OwnMemory          │
  88. ──────────────────────┘
  89.  
  90.    See explanation below
  91.  
  92. ──────────────────────┬─────────────────────────────────────────────────────────
  93.    DMAPlay_Chan       │
  94. ──────────────────────┘
  95.    Set this to 1 or 3 depending on which DMA channel you prefer.
  96.    Set to 0 if you don't want DMA transfer.
  97.    Must be initialized BEFORE calling AMS_Init
  98.  
  99. ──────────────────────┬─────────────────────────────────────────────────────────
  100.    GF1IRQ             │
  101. ──────────────────────┘
  102.    Set this to 2,3,5,7,11,12 or 15 depending on which IRQ you prefer.
  103.    Must be initialized BEFORE calling AMS_Init
  104.  
  105.  
  106.  
  107. The following routines are available in the system at the moment:
  108.  
  109. ──────────────────────┬─────────────────────────────────────────────────────────
  110.    AMS_Init           │
  111. ──────────────────────┘
  112.  
  113.    Calls:   None/OwnMemory
  114.    Does:    Inits the music system, allocates memory, find GUS, etc.
  115.             If you need your own memory in your code you MUST use the variable
  116.             "OwnMemory" instead of Tran's allocation routines. That's because
  117.             the player routine uses all memory it can get. You can only use the
  118.             variable BEFORE calling AMS_Init, and therefore you can only
  119.             allocate once, but that should be no problem.
  120.  
  121.    Example:
  122.             mov         OwnMemory,100000        ;Get 100000 bytes for your code
  123.             call        AMS_Init                ;Init, Address to own mem is in
  124.                                                 ;the Variable OwnMemory
  125.  
  126.             mov         edi,OwnMemory           ;Erase own memory
  127.             mov         ecx,100000/4
  128.             xor         eax,eax
  129.             rep         stosd
  130.  
  131.  
  132. ──────────────────────┬─────────────────────────────────────────────────────────
  133.    AMS_ReadCommandLine│
  134. ──────────────────────┘
  135.  
  136.    Calls:   None
  137.    Does:    Read the CommandLine and put the result in the string "Modname"
  138.             This string is 100 bytes long.
  139.  
  140.    Example:
  141.             Call        AMS_ReadCommandLine
  142.  
  143. ──────────────────────┬─────────────────────────────────────────────────────────
  144.    AMS_LoadModule     │
  145. ──────────────────────┘
  146.  
  147.    Calls:   None/LoadOffset
  148.    Does:    Loads the Module found in string "Modname" into memory.
  149.             If the variable LoadOffset is set to an offset, the loader will
  150.             skip to that offset before reading the module. That way you can
  151.             have the module copied onto the EXE file and load the mod from
  152.             the end of the EXE file.
  153.  
  154.    Example:
  155.             Call        AMS_LoadModule
  156.  
  157. ──────────────────────┬─────────────────────────────────────────────────────────
  158.    AMS_StartModule    │
  159. ──────────────────────┘
  160.    Calls:   None
  161.    Does:    Start the playing of the current loaded module.
  162.  
  163.    Example:
  164.             Call        AMS_StartModule
  165.  
  166. ──────────────────────┬─────────────────────────────────────────────────────────
  167.    AMS_StopModule     │
  168. ──────────────────────┘
  169.    Calls:   None
  170.    Does:    Stops the playing of the current playing module.
  171.  
  172.    Example:
  173.             Call        AMS_StopModule
  174.  
  175.  
  176. ──────────────────────┬─────────────────────────────────────────────────────────
  177.    AMS_ShutDown       │
  178. ──────────────────────┘
  179.    Calls:   None
  180.    Does:    Resets the musicsystem and eveything else needed.
  181.             Should only be used just before quitting the program.
  182.  
  183.    Example:
  184.             Call        AMS_ShutDown
  185.  
  186.  
  187.  
  188. 2.1 - Error Handler
  189. -------------------
  190.  If some error occurs in the AMS_ routines, the procedure called
  191.  "AMS_ErrorHandler" gets control over the situation, and it's up to you to
  192.  correct the error by displaying a error message or whatever is needed.
  193.  
  194.  When the errorhandler gets control, ESI points to a text describing the error
  195.  and EBX contains an error number. The following table explains EBX:
  196.  (It may be odd to not have all numbers represented, but in the tracker more
  197.   errors are available, and I just removed the unnecessary ones)
  198.  
  199. EBX    Explanation
  200. ──────────────────────
  201. 02h    Extremely low base mem
  202. 04h    Extremely low high mem
  203. 0ah    Not enough High memory
  204. 10h    Not enough GUS memory
  205. 11h    Error opening file
  206. 12h    Error seeking in file
  207. 13h    Error reading in file
  208. 14h    No loadable module
  209. 15h    Bad AMS Version
  210. 16h    Error creating file
  211. 17h    Error Writing file
  212. 18h    Error Closing file
  213. 19h    Error determining size of file
  214. 1ah    Error deleting file
  215. 1eh    IRQ Timeout
  216. 1fh    No GUS Found
  217.  
  218.  
  219.  
  220. 3.0 - Problems?
  221. ---------------
  222.  
  223. If you encounter any problems, feel free to contact Baldric. (preferably
  224. by E-Mail)
  225.  
  226. Baldric (Patrik Oscarsson)
  227.    Bondstorps Wärdshus
  228.       562 91 Månsarp
  229.           Sweden
  230.  
  231.   Voice: +46(0)393-40012
  232.   E-Mail: da94ospa@hj.se
  233.  
  234.  
  235. 3.1 - Credits
  236. -------------
  237.  
  238. The Music System is developed and coded by Baldric of Extreme.
  239. The Protected mode header is made by Tran (Thomas Pytel)
  240.  
  241.  
  242.  
  243. 3.2 - Last notes
  244. ----------------
  245.  
  246. * This small system was made in quite a hurry, so there may be some bug in it,
  247.   even if I haven't found any.
  248.  
  249. * The loader only recognizes AMS and MOD formats even if the player supports
  250.   S3M and STM as well.
  251.  
  252. * Why so many .OBJ files??
  253.  
  254.   pmode    -  The main Protected mode header
  255.   io       -  Input/Output routines for Pmode
  256.   ams      -  The Music System.
  257.   amsshell -  A shell to communicate with the Music System.
  258.   play     -  The player.
  259.  
  260.  
  261.